Skip to content

CAMEL-22545 new camel-huggingface component#21449

Open
johnpoth wants to merge 1 commit intoapache:mainfrom
johnpoth:huggingface
Open

CAMEL-22545 new camel-huggingface component#21449
johnpoth wants to merge 1 commit intoapache:mainfrom
johnpoth:huggingface

Conversation

@johnpoth
Copy link
Member

@johnpoth johnpoth commented Feb 13, 2026

Description

https://issues.apache.org/jira/browse/CAMEL-22545

This introduces a new camel-huggingface component that provides an easy-to-use integration with the Hugging Face models. It leverages the Deep Java Library (DJL) Python engine to run Hugging Face Transformers pipelines directly.

For example, to use the Qwen2.5-3B-Instruct model:

from("direct:start-chat")
    .to("huggingface:chat?modelId=Qwen/Qwen2.5-3B-Instruct");

Thanks !

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

<dependency>
<groupId>ai.djl.python</groupId>
<artifactId>python</artifactId>
<version>0.28.0</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be externalised to the parent pom?

@jamesnetherton
Copy link
Contributor

@johnpoth johnpoth force-pushed the huggingface branch 3 times, most recently from 5e20dbe to d79b07c Compare February 16, 2026 10:05
@johnpoth johnpoth force-pushed the huggingface branch 2 times, most recently from f42691e to f477103 Compare February 16, 2026 13:02
@johnpoth
Copy link
Member Author

Done, thanks for reviewing!

String doSample = config.getTemperature() > 0 ? "True" : "False";
float temperature = config.getTemperature() > 0 ? config.getTemperature() : 1.0f;
String tokenClause = config.getAuthToken() != null ? ", token='" + config.getAuthToken() + "'" : "";
return """
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnpoth this not a blocker, but what about moving the python code under the resources folder in its .py file? so that it can be retrieved and returned by these getPythonScript()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants